<?

/*
*
*   Excalibur Content Management System
*   Copyright © 2008 Egor "Sontan" Kuryanovich
*
*   Based on Explay Engine v2.0 by Golovdinov Alexander
*
*   Official site: www.excms.ru
*   Contact e-mail: support@excms.ru
*
*   GNU General Public License original source:
*   http://www.gnu.org/licenses/gpl-3.0.html
*
*/


$id = intval (_get(2));

if ($id == "") error_404 ();

$SITE = $db->fetch_array ($db->query ("SELECT * FROM site_main"));

$get_art = $db->query ("SELECT * FROM ".DB_PEREFIX."_articles WHERE art_id = '$id'");
$ART = $db->fetch_array ($get_art);

$get_comm = $db->query ("SELECT * FROM ".DB_PEREFIX."_comments WHERE com_category = 'articles' && com_idi = '$id'");
$count = $db->num_rows ($get_comm);

$author = $db->fetch_array ($db->query ("SELECT user_name FROM ".DB_PEREFIX."_users WHERE user_id = '".$ART['art_author']."'"));
$cat_ = $db->fetch_array ($db->query ("SELECT cat_header FROM ".DB_PEREFIX."_art_category WHERE cat_name = '".$ART['art_category']."'"));

($ART['auto_tag'] == "yes") ? $body = n2br ($ART['art_body']) : $body = $ART['art_body'];

$body = replace_symbols ($body);

print "<title>".$ART['art_header']." - ".$SITE['site_name']."</title>
<h2>".$ART['art_header']."</h2>
".$body."
<hr />Автор: ".$author['user_name']."
<br />Категория: ".$cat_['cat_header']."
<br />Дата: ".format_time($ART['art_date'])."
<br />Комментариев: $count
<p /><a href='http://".$_SERVER['HTTP_HOST']."/articles/$id.html'>http://".$_SERVER['HTTP_HOST']."/articles/$id.html</a>";


?>
